<?php
include("../Core/Common.php");
$title='自助购买';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?=$title?></title>
</head>
<link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <!--[if lt IE 9]>
    <script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
    <script src="http://libs.useso.com/js/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a  class="navbar-brand" href=""><?=$title?></a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="navbar-collapse collapse" aria-expanded="false" style="height: 1px;">
        <ul class="nav navbar-nav navbar-right">
              <li>
            <a href="/index.php"> 正版查询</a>
          </li>
          <li><a href="/Get"> 程序下载</a></li>   
          <li><a href="./Buy.php"> 自助购买</a></li>  
          <li><a href="/Daili"> 授权商登录</a></li>  
            </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title><?=$title?></title>
    <!--baidu-->
    <meta name="baidu-site-verification" content="4IPJiuihDj" />
    <!-- Bootstrap -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<div class="container" style="padding-top:70px;">

<?php if(!empty($confs['sygg'])){?>
<footer class="footer text-center">
<a rel="external nofollow" href="<?php echo $confs['syurl']?>" target="_blank"><img width="100%" height="80" src="<?php echo $confs['sygg']?>"></a>
</footer>
<?php } ?>

<br>
	
<!--<div class="container"><hr>
<h5 class="form-signin-heading"></h5>-->

<?php if(empty($confs['qtgg'])){?>
<div style="color: #FF8C00;">
<b><?php echo $confs['qtgg']?></b></div>
<?php } ?>

<?php if(empty($confs['gdgg'])){?>
<div class="list-group-item reed"><marquee scrollamount="8" direction="left" align="Middle" style="font-weight: bold;line-height: 20px;font-size: 20px;color: #FF0000;" onmouseover="stop();" onmouseout="start();"> <!--<img border="0" width="32" src="http://i1.buimg.com/1949/17b5756df327b191.png">-->成功购买后请10分钟内使用授权QQ去登录下载源码!</marquee></div>
<center></br>
<?php } ?>

<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">自助购买</h3></div>
<form action="?" method="get" name="auth" value="1">
<input type="hidden" name="auth" id="auth" value="auth"/>
<div class="panel-body">
		<div class="form-group">
		  <div class="input-group"><div class="input-group-addon">授权域名 </div>
<input type="text" class="form-control" name="url" id="url" value="" placeholder="不用带http://...//">
	    </div></div>
		<div class="form-group">
		  <div class="input-group"><div class="input-group-addon">授权QQ号 </div>
<input type="text" class="form-control" name="qq" id="qq" value="" placeholder="请正确填写,否则不能下载源码">
	    </div></div>
<div class="form-group">
<pre class="form-control"><font color="green">当前价格：<?=$conf['pay_money']?></font></pre>
<pre class="form-control"><font color="green"><a href="http://<?=$_SERVER['HTTP_HOST']?>/User">购买后使用授权的QQ登录下载源码(或点此去下载)</a></font></pre>
					<dt>支付方式：</dt>
                    <dd>
                        <label><input type="radio" id="type" name="type" value="alipay" checked=""><img src="/Core/Assets/Icon/alipay.ico" width="16" onerror="this.style.display=\'none\'">支付宝</label>&nbsp;&nbsp;<input type="radio" id="type" name="type" value="qqpay"><img src="/Core/Assets/Icon/qqpay.ico" width="16" onerror="this.style.display=\'none\'">QQ钱包</label>&nbsp;&nbsp;<input id="type" type="radio" name="type" value="wxpay"><img src="/Core/Assets/Icon/wechat.ico" width="16" onerror="this.style.display=\'none\'">微信</label><label>
                    </dd>
</div>
<button type="submit" class="btn btn-primary btn-block">生成订单</button><br>
<?php
if($url=addslashes($_GET['url']) and $qq=addslashes($_GET['qq'])) {
	$out_trade_no=date("YmdHis").rand(11111,99999);
	$data_msg = $url.'|'.$qq;
	$type = addslashes($_GET['type']);
	$name = '购买INTL_Pay授权';
	$money = $conf['pay_money'];
	$query = $DB->query("insert into `pay_order` (`out_trade_no`,`data_msg`,`type`,`name`,`money`,`addtime`,`status`) values ('".$out_trade_no."','".$data_msg."','".$type."','".$name."','".$money."','".$date."','0')");
	if($query){
		echo '<div class="alert alert-success"><font color="#FF0000">订单生成成功,3秒后进入支付页面!</b></font></div><meta http-equiv="refresh" content="3;URL=Php_Sdk/epayapi.php?out_trade_no='.$out_trade_no.'">';
	}else{
		echo '<div class="alert alert-danger"><font color="#FF0000">订单生成失败,请重试!</b></font></div>';
	}
}elseif($_GET['auth']){
		echo '<div class="alert alert-danger"><font color="#FF0000">输入不全,请重新输入</b></font></div>';
}
$DB->close();
?>

	    </div>
		</div>
      </div>
<p style="text-align:center"><br>&copy; Powered by <a href="http://wpa.qq.com/msgrd?v=3&uin=2409804436&site=qq&menu=yes">惜语</a></p></div>
</div>
</div>
</center>
</body>
</html>